{% extends "common/layout_main.html" %}
{% block content %}
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li class="current">
                    <a href="{{ buildUrl('/switch/') }}">交换机列表</a>
                </li>

            </ul>
        </div>
    </div>
</div>
<div class="row m-t">
	<div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="m-b-md">
					<a class="btn btn-outline btn-primary pull-right" href="{{ buildUrl('/switch/set') }}?id={{ info.id }}">
                        <i class="fa fa-pencil"></i>编辑
                    </a>
					<h2>账户信息</h2>
                </div>
            </div>
        </div>
        <div class="row">

            <div class="col-lg-10">
                <p class="m-t">交换机IP：{{ info.ipaddr }}</p>
                <p>备注：{{ info.note }}</p>
             </div>
        </div>
 <div class="row m-t">
            <div class="col-lg-12">
                <div class="panel blank-panel">
                    <div class="panel-heading">
                        <div class="panel-options">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="javascript:void(0);" data-toggle="tab" aria-expanded="false">端口详情</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="tab-content">
                            <div class="tab-pane active">
                                <table class="table table-bordered">
                                    <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>端口号</th>
                                            <th>MAC地址</th>
                                            <th>IP地址</th>
                                            <th>上次扫描时间</th>
                                        </tr>
                                    </thead>
                                    <tbody>
									{% if macinfo %}
                                            {% for item in macinfo %}

                                               <tr>
                                               <td>{{ loop.index }}</td>
                                             <td>{{ item.MAC.port }}</td>
                                               <td>{{ item.MAC.macadd}}</td>
                                               <td>{{ item.ARP.ipaddr }}</td>
                                               <td>{{ item.MAC.update_time }}</td>
                                             </tr>

                                        {% endfor %}
                                        {% else %}
                                        <td colspan="5">暂无数据</td>
                                    {% endif %}

                                     </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
	</div>
</div>
{% endblock %}
